home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d963.lha
/
SIOD
/
scm
/
scambia-all.scm
< prev
next >
Wrap
Text File
|
1993-02-22
|
634b
|
19 lines
(define (scambia-all lis x y)
(define pila (make-pila))
(define l lis)
(do ()
((and (null? l) (empty-pila? pila)) lis)
(cond ((null? l)
(set! l (top pila))
(pop pila))
((pair? (car l))
(push (cdr l) pila)
(set! l (car l)))
((eq? x (car l))
(set-car! l y)
(set! l (cdr l)))
((eq? y (car l))
(set-car! l x)
(set! l (cdr l)))
(else (set! l (cdr l))))))